package com.cong.project.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cong.project.model.entity.Content;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cong.project.model.request.*;
import com.cong.project.model.vo.PostDetailVo;
import com.cong.project.model.vo.PostVo;

/**
* @author 86188
* @description 针对表【content(用户发布内容信息表)】的数据库操作Service
* @createDate 2022-10-11 15:34:33
*/
public interface ContentService extends IService<Content> {

    /**
     * 获得帖子列表
     *
     * @param tokenUserRequest 令牌用户请求
     * @param pageRequest      页面请求
     * @return {@link IPage}<{@link PostVo}>
     */
    IPage<PostVo> getPostList(TokenUserRequest tokenUserRequest, PostQueryRequest postQueryRequest);


    /**
     * 添加文章
     *
     * @param tokenUserRequest 令牌用户请求
     * @param postAddRequest   post添加请求
     * @return {@link Boolean}
     */
    Boolean addPost(TokenUserRequest tokenUserRequest, PostAddRequest postAddRequest);

    /**
     * 删除帖子
     *
     * @param tokenUserRequest  令牌用户请求
     * @param postDeleteRequest 帖子删除请求
     * @return {@link Boolean}
     */
    Boolean deletePost(TokenUserRequest tokenUserRequest, PostDeleteRequest postDeleteRequest);

    /**
     * 得到文章细节
     *
     * @param tokenUserRequest 令牌用户请求
     * @param postId           post id
     * @return {@link PostVo}
     */
    PostDetailVo getPostDetail(TokenUserRequest tokenUserRequest, Long postId);
}
